Skip to content

Bridge S1: pattern + limit addressing, match report, distributions, broaden (#14367) - #14412

Merged
developing-today-fleet[bot] merged 2 commits into
mainfrom
felix/14367-bridge-pattern-limit
Nov 24, 2026
Merged

developing-today-fleet[bot] merged 2 commits into
mainfrom
felix/14367-bridge-pattern-limit

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Implements bridge build-out slice S1 (design doc/2026-11-24_design_message-bridge-buildout.md §4.1, via PR #14364).

What

  • One glob matching rule (new src/glob.js): case-insensitive, name-segment glob, deterministic name order — shared by the fleet and notes surfaces.
  • Fleet: agent:<glob> in parseTargets and the relay grammar, resolved against the registry at send time; optional limit: N delivers to the first N matches in name order; every send returns a match report {matched, delivered, recipients, remaining}. Zero matches stays an error.
  • Distributions: new additive table bridge_distribution (batch, sender_addr, pattern, limit_n, matched, delivered, ts), written for every fleet and notes send; S2's pipeline consumes it.
  • Broaden: a follow-up send with broaden: <batch> and an optional new limit/pattern re-delivers the original body to exactly the matched-but-undelivered remainder — the delivered set is the record, so a second identical broaden delivers nothing. Only the original sender (or central, on the fleet surface) may broaden.
  • Notes: segment globs (muse/f*), limit + match report on sends, note_message gains an additive batch column, distributions recorded in the same table, broaden with the same remainder semantics.
  • MCP send_message gains limit/broaden and returns the match report as report.

Verification

Remote via the fleet-command workflow (developing-today/fleet):

New tests name the acceptance oracles: glob+limit first-in-name-order with matched 2 / delivered 1 / remaining 1, broaden delivering exactly the remainder, a second broaden delivering nothing, distribution record contents, notes limit/report/broaden, and the relay/MCP path.

Left UNMERGED for Felix's review.

Closes #14367

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T14:15:49Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "c11f41086f57d626be7eb582763b721f8f557408"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…, broaden (#14367)

Design doc/2026-11-24_design_message-bridge-buildout.md §4.1, slice S1:

- One glob matching rule (src/glob.js): case-insensitive name-segment
  glob, deterministic name order, shared by fleet and notes surfaces.
- Fleet: agent:<glob> in parseTargets/relay grammar, resolved against
  the registry at send time; optional limit N delivers to the first N
  matches; every send returns a match report {matched, delivered,
  recipients, remaining} and records a bridge_distribution row (batch,
  sender_addr, pattern, limit_n, matched, delivered, ts).
- Broaden: a follow-up send with broaden:<batch> and an optional new
  limit/pattern delivers the original body to exactly the
  matched-but-undelivered remainder — the delivered set is the record,
  so nobody gets a batch twice. Only the original sender (or central)
  may broaden.
- Notes: segment globs (muse/f*), limit + match report on sends,
  note_message gains a batch column, distributions recorded in the
  same table, broaden with the same remainder semantics.
- MCP send_message gains limit/broaden and returns the match report.

Tests: new node --test oracles in fleet/notes/relay suites naming the
acceptance criteria (glob+limit name order, broaden remainder,
idempotent re-broaden, distribution record contents).
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04613bd2-2f02-4722-9218-cd4f23ce03dc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Verification evidence (run 45410331060, developing-today/fleet fleet-command, target HEAD e7cd26e, conclusion success):

  • 81 tests across 8 files — 81 pass, 0 fail (the full worker suite: bridge, chatgpt-site, events, fleet, notes, oauth ×2, relay).
  • New S1 tests, all passing by name:
    • fleet: glob targets parse like names, and malformed globs are refused; pattern send with limit: first match in name order, match report, broaden remainder (the Bridge build-out S1 — pattern + limit addressing (worker) #14367 oracle: agent:f* → matched 2, delivered 1, recipients [fable], remaining 1; broaden limit 2 → exactly falcon; second broaden → 0); a glob matching nobody is an error, like an empty group; limit applies across group and all sends, in name order; broaden can widen the pattern and still never re-delivers; every pattern send writes its bridge_distribution record (record asserted directly: pattern agent:f*, limit_n 1, matched [fable, falcon], delivered [fable], updated by broaden).
    • notes: notes pattern sends: limit, match report, glob segments, broaden remainder (incl. foreign-sender broaden refused).
    • relay: addresses accept agent globs and refuse malformed ones; a connector sends to a glob with a limit, reports the match, then broadens (the MCP path).

Runner note: the executor image has no node (run 45407007273 died node: command not found, exit 127 — code#14267 / dezren39/fleet#111), so per the documented fallback the suites ran under the image's bun 1.4.5 test runner, which executes the same node:test/node:sqlite suites npm test runs under node. Run 45408733220 records the intermediate step (bun present, target HEAD verified; bun <file> refuses node:test files outside bun test).

Acceptance: all four #14367 criteria are covered by the named tests above. PR left unmerged for Felix's review.

…ttern-limit

# Conflicts:
#	pkgs/message-bridge/worker/src/fleet.js
#	pkgs/message-bridge/worker/src/index.js
#	pkgs/message-bridge/worker/src/messages.js
@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Merge refresh (felix lane): merged current origin/main (1e06e715d) into this branch — new head 12fd5f0a2c — to clear the conflicts left by S2 (#14409) and S3 (#14407) landing on the same worker files. Three files conflicted; every conflict was additive on both sides and both sides survive intact:

  • src/fleet.js — inside fleetSchema: kept S3's fleet_credential and enroll_token tables and S1's bridge_distribution table (all three now created); S1's recordDistribution/getDistribution follow as top-level functions.
  • src/index.js — the fleet.js import is the union: S3's enroll/credential SQL helpers plus S1's getDistribution/recordDistribution. The Durable Object side already carried both feature sets (credential methods, distribution/broaden calls, S2's noteOwnerList/noteDirectory, and the storeFor wrappers) and merged cleanly.
  • src/messages.js — MemoryStore constructor now initialises all three maps (distributions, fleetCredentials, enrollTokens); S3's credential/enroll/note-revoke methods kept whole alongside S1's distribution-recording noteDeliver.

notes.js and routes.js auto-merged. No duplicate definitions; anonymity projections untouched.

Re-verification (remote, fleet-command run 45416882627, Target HEAD verified 12fd5f0a2cf9c5563ac90521282e38193a97d6c3): full worker suite under the bun-test fallback — 93 pass / 0 fail, 93 tests across 10 files (the S1 tree's 81 plus S2's 6 pipeline tests and S3's 6 credential tests). Run conclusion success. Left unmerged for Felix's merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bridge build-out S1 — pattern + limit addressing (worker)

0 participants